﻿using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Ioc;
using Windows.Storage;

namespace Mutzl.Samples.MapApp.ViewModel
{
    // Todo 12. ... samt Anpassungen im SettingsViewModel ...
    public class SettingsViewModel : ViewModelBase
    {
        [PreferredConstructor]
        public SettingsViewModel()
        {
            SettingsContainer = ApplicationData.Current.LocalSettings;
        }

        public static string ShowSonderObjekteProperty = "ShowSonderObjekte";

        private readonly ApplicationDataContainer SettingsContainer;



        public bool ShowSonderObjekte
        {
            get { return (bool?) SettingsContainer.Values[ShowSonderObjekteProperty] ?? true; }
            set 
            { 
                SettingsContainer.Values[ShowSonderObjekteProperty] = value;
                RaisePropertyChanged(() => ShowSonderObjekte);
            }
        }

    }
}
